from types import SimpleNamespace

data = SimpleNamespace(a=1, b=2, c=[1, 2, 3])
print(data)
print(data.a, data.b, data.c)
data.d = {"name": "vincent"}
print(data)
repr(data)


class CustomSimpleNamespace(SimpleNamespace):
    def __repr__(self):
        keys = sorted(self.__dict__)
        items = (f'{k}: {self.__dict__[k]}' for k in keys)
        return f'{type(self).__name__}({",".join(items)})'


custom_data = CustomSimpleNamespace(a=1, b=2, c=[1, 2, 3])
print(custom_data)
